import {Actor, Action} from 'iflux2';
import {RefundType} from '../constant/action-type';


export default class RefundActor extends  Actor {
    defaultState() {
        return {
            applyRefundAmount: 0,
            payAmount: 0,
            tradeOrder: {},
            payTypeBOList: []
        }
    }


    @Action(RefundType.SET_REFUND)
    setRefund(state, {applyRefundAmount, payAmount, tradeOrder, payTypeBOList}) {
        return state.set('applyRefundAmount', applyRefundAmount)
            .set('payAmount', payAmount)
            .set('tradeOrder', tradeOrder)
            .set('payTypeBOList', payTypeBOList);
    }
}